import Vue from "vue"

import Vuex from "vuex"

Vue.use(Vuex)

// 创建state对象
const state = {
  count: 1,
  price: "¥99"
}

// 创建mutations对象
const mutations = {
  increment(state) {
    state.count++
  },
  decrement(state) {
    state.count--
  },
  incrementN(state, { n }) {
    state.count += n
  }
}

export default new Vuex.Store({
  state,
  mutations
})